package com.ayz.gateway.core.core.common;

import cn.hutool.core.util.StrUtil;

/**
 * @ClassName UriParserUtils
 * @Description TODO: 请求URI参数解析
 * @Author 快乐的星球
 * @Date 2023/5/10 9:53
 * @Version 1.0
 **/
public class UriParserUtils {

    public static String getHttpUri(String uri){
        if(StrUtil.isNotEmpty(uri) && uri.length()>1){
            String substring = uri.substring(1);
            int indexOf = substring.indexOf("?");
            if(indexOf!=-1){
                return substring.substring(0,indexOf);
            }else{
                return substring.substring(0,substring.length());
            }
        }
        return null;
    }
}
